package com.xayy.health.ds.controller;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil;
import cn.kawins.base.result.ResultBody;
import cn.kawins.mybatis.base.BaseController;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.github.pagehelper.PageInfo;
import com.xayy.health.core.enums.WebsocketTopicEnum;
import com.xayy.health.ds.service.DsTaskChildInfoService;
import com.xayy.health.mgt.model.DataQuality;
import com.xayy.health.mgt.model.DataQualityReport;
import com.xayy.health.mgt.model.TaskInfo;
import com.xayy.health.mgt.model.dto.DataFeatureDto;
import com.xayy.health.mgt.model.dto.DataQualityDto;
import com.xayy.health.mgt.model.dto.TelemetryDto;
import com.xayy.health.mgt.model.vo.*;
import com.xayy.health.mgt.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author zhangxa
 */
@RestController
@RequestMapping(value = "/data")
@Api(tags = "数据处理")
public class DsDataController extends BaseController<DataQuality> {

    @Autowired
    DsTaskChildInfoService dsTaskChildInfoService;

    /**
     * 批量（单个）删除任务及其子任务
     * @param taskVo 任务入参
     * @return ResultBody
     */
    @ApiOperation(value = "批量（单个）删除任务及其子任务")
    @PostMapping("/deleteChildTask")
    public ResultBody deleteChildTask(@RequestBody TaskVo taskVo) {
        return dsTaskChildInfoService.deleteChildTask(taskVo).body();
    }

//    /**
//     * 子任务参数处理展示
//     * @param taskInfo 任务信息入参
//     * @return ResultBody
//     */
//    @ApiOperation(value = "子任务参数处理展示")
//    @PostMapping("/getAlgorithmTypeByChild")
//    public ResultBody getAlgorithmTypeByChild(@RequestBody TaskInfo taskInfo) {
//        return dsTaskChildInfoService.getAlgorithmTypeByChild(taskInfo).body();
//    }

}
